/*
 * Copyright (C) 2022 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "mock_iuser_auth_interface.h"

#include "memory"

namespace OHOS {
namespace UserIam {
namespace UserAuth {

std::shared_ptr<IUserAuthInterface> HdiWrapper::GetHdiInstance()
{
    return MockIUserAuthInterface::Holder::GetInstance().Get();
}

sptr<IRemoteObject> HdiWrapper::GetHdiRemoteObjInstance()
{
    sptr<IRemoteObject> tmp(nullptr);
    return tmp;
}

std::shared_ptr<MockIUserAuthInterface> MockIUserAuthInterface::Holder::Get()
{
    if (!mock_) {
        mock_ = std::make_shared<MockIUserAuthInterface>();
    }
    return mock_;
}

void MockIUserAuthInterface::Holder::Reset()
{
    mock_ = nullptr;
}
} // namespace UserAuth
} // namespace UserIam
} // namespace OHOS
